<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>划转</title>
    <meta charset="utf-8">
    <link href="__CSS__/bootstrap.min.css" rel="stylesheet">
    <link href="__CSS__/bootstrap.css" rel="stylesheet">
    <link href="__CSS__/Login.css" rel="stylesheet">
    <!--<script src="__JS__/jquery-1.7.2.min.js"></script>-->
    <script src="__JS__/jquery-1.7.2.min.js"></script>
    <!--<script src="__JS__/layer/layer.js"></script>-->
    <script src="__PUBLIC__/lib/layer/layer.js"></script>
    <script src="__JS__/bootstrap.min.js"></script>
    <script src="__JS__/jquery.qrcode.min.js"></script>
</head>

<style type="text/css">
    .inputys{background-color:rgba(255,255,255,0); height:50px;outline: none; border:0px; color:#333;width:60%;font-size: 12px;
        margin-left: 1rem;}
    .col-xs-8{
        width:13rem;
        padding:0;
    }
    .form-control2{
        width:50%;
        border: none;
        outline: none;
        background:transparent;
        display: inline-block;
        height: 34px;
        font-size: 14px;
        line-height: 1.42857143;
        color: #555;
        /*float: left;*/
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;


        background:url('__IMG__/ex/down.png') no-repeat scroll right center transparent;
        background-size: 20% 40%;
        padding-right: 14px;
    }

    .transffer{
        background:#EC1C24;
        -webkit-border-radius: 12px;
        -moz-border-radius: 12px;
        border-radius: 12px;
        border: none;
        outline: none;
        color: #fff;
        line-height: 2rem;
        padding: 0 1rem;
    }
    .title1 div {
        display: inline-block;
    }
    .col-xs-8 img{
        display: none;
        width:2rem;
        margin-right:.5rem;
    }
    .t3{
        font-size: 14px;
        color: #000;
    }
    ol,li{
        margin: 0;
    }
    /*.col-xs-4{*/
    /*    width: 33%;*/
    /*}*/
    #btn-2{
        background-color: #E63C2D;
        height: 50px;
        width: 100%;
        line-height: 50px;
        text-align: center;
        font-size: 18px;
        color: #fff;
        padding-left: 15px;
        padding-right: 15px;
        border-radius: 4px;
        border: 0px
    }
</style>

<body style="margin-top: 38px">
<div class="title1" style="background:#fff;border-bottom: 2px solid #F1F3F4;top: 35px">
    <div style="float:left;text-align:left;width: 2rem;margin-left: 1.5rem;">
        <a href="{:U('Finance/locked_list')}" style="color:#333;">
            <img src="/Public/Home/images/ex/back_black.png" alt="" width="50%">
        </a>
    </div>
    <!--<div  style="color: #fff;text-align: left;float:left;">我的理财</div>-->
    <div  style="color: #000;text-align: left;float:left;">transfer</div>
    <a href="{:U('Finance/locked_list')}" style="float: right;margin-right: 1rem;color: #000" >All </a>
    <!--<div class=" col-xs-4" id="scan"><img src="__IMG__/richscan_icon.png" style="height:25px;float: right;"></div> -->
</div>

<div class="container" style=" padding-top:40px;">
    <!--<div class="row-fluid qk" >-->
    <!--<div style=" height:50px; line-height:50px; font-size:16px; ">-->
    <!--<div style=" float:left; padding-left:15px;" class="col-xs-4 t3">-->
    <!--资产-->
    <!--</div>-->
    <!--<div style="float:left; width:45%; padding-left:15px; color:#FFF;">-->
    <!--<select class="form-control t3">-->
    <!--<option value="1">ASSET</option>-->
    <!--<option value="2">USDT</option>-->
    <!--<option value="3">资产券</option>-->
    <!--</select>-->
    <!--</div>-->

    <!--<div style=" float:right; padding-right:15px; text-align:right; color:#475377;">-->
    <!--<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->

    <!--<div class="row-fluid qk" >-->
    <!--<div style=" height:50px; line-height:50px; font-size:16px; ">-->
    <!--<div style=" float:left; padding-left:15px;" class="col-xs-4 t3">-->
    <!--资产-->
    <!--</div>-->
    <!--<div style="float:left; width:45%; padding-left:15px; color:#FFF;">-->
    <!--<select class="form-control t3">-->
    <!--<option value="1">ASSET</option>-->
    <!--<option value="2">资产券</option>-->
    <!--</select>-->
    <!--</div>-->

    <!--<div style=" float:right; padding-right:15px; text-align:right; color:#475377;">-->
    <!--<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
    <!--<div class="row-fluid qk" >-->
    <!--<div style=" height:50px; line-height:50px; font-size:16px; ">-->
    <!--<div style=" float:left; padding-left:15px;">-->
    <!--<img src="__IMG__/B.png" width="30" />-->
    <!--</div>-->
    <!--<div style="float:left; width:45%; padding-left:15px; color:#FFF;">-->
    <!--BTC-->
    <!--</div>-->

    <!--<div style=" float:right; padding-right:15px; text-align:right; color:#475377;">-->
    <!--<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->

    <div class="row-fluid qk" >
        <div style=" height:50px;">
            <div class="col-xs-4 t3" style=" float:left; height:50px; line-height:50px;">Currency</div>
            <div class="col-xs-8" style=" float:right;text-align: right; height:50px; line-height:50px;" >
                <!--                    <select class="form-control" style="margin-top: 5px;" id="from">-->
                <!--                        <option value="8">USDT</option>-->
                <!--                        &lt;!&ndash;<option value="11">EASY</option>&ndash;&gt;-->
                <!--                        &lt;!&ndash;<option value="7">ASSET</option>&ndash;&gt;-->
                <!--                        &lt;!&ndash;<option value="0">BTC</option>&ndash;&gt;-->
                <!--                        &lt;!&ndash;<option value="0">ETH</option>&ndash;&gt;-->
                <!--                        &lt;!&ndash;<option value="0">EOS</option>&ndash;&gt;-->
                <!--                    </select>-->
                <span style="padding:.3rem;">Available assets</span>
            </div>
            <!--                <div>可用资产(USDT)</div>-->
            <!--                <div>HuidBank 资产包</div>-->
        </div>


        <!--<div style=" height:50px;">-->
        <!--<div class="col-xs-4 t3" style=" float:left; height:50px; line-height:50px; padding-left:15px; color:#808bab;">接收账号</div>  -->
        <!--<div class="col-xs-8" style=" float:left; height:50px; line-height:50px;"> -->
        <!--<input type="text" id="mobile" placeholder="请输入账号" class="inputys" >-->
        <!--</div>-->
        <!--</div>-->
        <div class="line1"></div>


        <div style=" height:50px;">

            <div class="col-xs-8" style=" float:left;text-align: left; height:50px; line-height:40px;padding-left: 15px;">

                <img src="__IMG__/ex/USDT.png" id="china" alt="" width="1rem" style="display: inline">
                <img src="__IMG__/ex/exlogo1.png" id="taiguo" alt="" width="1rem">
                <img src="__IMG__/ex/Bitcoin.png" id="xinjiapo" alt="" width="1rem" >
                <img src="__IMG__/ex/Ethereum.png" id="malai" alt="" width="1rem">
                <img src="__IMG__/ex/Litecoin.png" id="EU" alt="" width="1rem" >
                <!--                    <img src="__IMG__/ex/riben.png" id="riben" alt="" width="1rem" >-->
                <img src="__IMG__/ex/OMG.png" id="hanguo" alt="" width="1rem">
                <img src="__IMG__/ex/XRP.jpg" id="xrp" alt="" width="1rem">
                <img src="__IMG__/ex/BCH.png" id="bch" alt="" width="1rem">
                <img src="__IMG__/ex/EOS.png" id="eos" alt="" width="1rem">
                <!--                    <img src="__IMG__/ex/down.png"  alt="" width="1rem" style="display:inline-block;">-->

                <select class="form-control2" style="margin-top: 5px;" id="from1" onchange="role()" v-model="selected">
                    <option value="8" >USDT</option>
                    <!--<option value="2">DACM</option>-->
                    <!--<option value="3">BTC</option>-->
                    <!--<option value="4">ETH</option>-->
                    <!--<option value="5">LTC</option>-->
                    <!--<option value="6">OMG</option>-->
                    <!--<option value="7">XRP</option>-->
                    <!--<option value="8">EOS</option>-->
                    <!--<option value="9">BCH</option>-->

                </select>


            </div>

            <div class="col-xs-4 t3 usdt_money" style=" float:right;text-align: right; height:50px; line-height:50px;padding: 0;">{$lockData.amount}</div>

        </div>
        <div class="line1"></div>

        <div style=" height:50px;">
            <div class="col-xs-4 t3" style=" float:left; height:50px; line-height:50px;width:22rem;">
                Input quantity:
                <input type="text" id="amount" placeholder="Input" class="inputys"/>
                <!--<input type="text" id="amount"  class="inputys" value="">-->
            </div>
            <div class="col-xs-4" style=" float:right;text-align: right; height:50px; line-height:50px;padding: 0;width: 6rem;">
                <button class="transffer">All</button>

            </div>

        </div>
        <!--<span style="float: right;color: #a9a9a9;font-size: 10px;">单笔起{$configData['a3']}~{$configData['a4']}</span>-->
        <div class="line1"></div>

        <div style=" height:50px;">
            <div class="col-xs-4 t3" style=" float:left; height:50px; line-height:50px;width: 100%;">
                pay password:<input type="password" id="password2" placeholder="input" class="inputys">
            </div>
        </div>
        <div class="line1"></div>
        <!--<span>余额:$0.00</span>-->

        <div style="margin-top:15px;font-size: 10px;padding-left: 15px;display:flex;align-items:center;justify-content:space-between">
            <div id="">
                <img src="__IMG__/tt.png" width="12" height="12"  />
            <!--            温馨提醒：规划范围：{$configData['a3']}-{$configData['a4']}元-->
            Fee:8%
            </div>
            
            <ol style="padding-left: 5px;">
                <li class="with_charge"></li>
                <!--<li>1.第一个月{$configData['a14']*100}%,第二个月{$configData['a15']*100}%,第三个月{$configData['a16']*100}%,第四个月{$configData['a17']*100}%,第五个月{$configData['a18']*100}%;</li>-->
                <!--<li>2.第六个月及以前{$configData['a19']*100}%.</li>-->

            </ol>
            <ol>
                <li>Miner's fee：{$configData.a53}DACM</li>
            </ol>
            <!--                <p>1.第一个月20%,第二个月15%,第三个月13%,第四个月10%,第五个月8%;</p>-->
            <!--                <p>2.第六个月及以前5%.</p>-->
        </div>
        <div style=" color:#475377; margin-top:15px;">
            <!--ASSET实时价格：{$coin_asset}，EASY实时价格：{$coin_easy}<br/><br/>-->
            <!--存币最低额度：{$configData['j2']}USDT-->
            <!--A1月收益：{$configData['p11']*100}%，金额范围：{$configData['p6']}-{$configData['p7']}元<br/>-->
            <!--A2月收益：{$configData['p12']*100}%，金额范围：{$configData['p8']}-{$configData['p9']}元<br/>-->
            <!--A3月收益：{$configData['p13']*100}%，金额范围：{$configData['p10']}元以上<br/>-->
            <!--<img src="__IMG__/tt.png" width="18" height="18"  />-->
            <!--GBC当前预售价格为：1GBC = 1CNY。-->
            <!--余额：资产券:{$userData['z1']}<br/> ASSET:{$userData['z7']}<br/>USDT:{$userData['z8']}-->
        </div>
        <if condition="$configData.finance_toggle eq 1">
            <div style=" margin-top:60px;">
                <button id="btn-1">One click swipe</button>
            </div>
            <else />
            <div style=" margin-top:60px;">
                <button id="btn-2">One click swipe</button>
            </div>
        </if>


    </div>

    <input type="hidden" id="from" value="{$lockData.coin_type}"/>
    <input type="hidden" id="lid" value="{$lockData.id}"/>


    <!--<div id="code" style="background-color: #FFF;width: 200px;margin: 25px auto 0;">     -->
    <!--</div>-->


</div>

</body>
</html>

<!--<script src="//gate.myapp.ltd/cdn/jsbridge-mini.js"></script>-->
<!--<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>-->

<script>

    function role(){
        var sel1 = document.getElementById('from');
        var index = sel1.selectedIndex;
        var value=sel1.options[index].value;
        console.log(value);
        if(value==1){
            $('.col-xs-8 img').css('display','none');
            $('#china').css('display','inline');
            $('#USD').css('display','inline')
        }else if(value==2){
            $('.col-xs-8 img').css('display','none');
            $('#taiguo').css('display','inline');
            $('#USD').css('display','inline')
        }else if(value==3){
            $('.col-xs-8 img').css('display','none');
            $('#xinjiapo').css('display','inline');
            $('#USD').css('display','inline')
        }
        else if(value==4){
            $('.col-xs-8 img').css('display','none');
            $('#malai').css('display','inline');
            $('#USD').css('display','inline')
        }else if(value==5){
            $('.col-xs-8 img').css('display','none');
            $('#EU').css('display','inline');
            $('#USD').css('display','inline')
        }else if(value==6){
            $('.col-xs-8 img').css('display','none');
            $('#hanguo').css('display','inline');
            $('#USD').css('display','inline')
        }else if (value==7) {
            $('.col-xs-8 img').css('display','none');
            $('#xrp').css('display','inline');
            $('#USD').css('display','inline')
        }else if (value==8) {
            $('.col-xs-8 img').css('display','none');
            $('#eos').css('display','inline');
            $('#USD').css('display','inline')
        }else {
            $('.col-xs-8 img').css('display','none');
            $('#bch').css('display','inline');
            $('#USD').css('display','inline')
        }
        // var price = $("#selectid option:selected").attr('price')
        // console.log(price)
        // $("#price").text(price)
        // $("#after").text('0.00')
        // $("#from_num").val('')
    }
</script>


<script type="text/javascript">
    $("#amount").blur(function () {
        var amount = $("#amount").val();
        var lid = $("#lid").val();
        $.post("{:U('Finance/with_charge')}",{amount:amount,lid:lid},function (data) {
            $(".with_charge").text(data.message);return false;
            // console.log(data);
        });
        // console.log(amount);
    });
    $(".transffer").click(function () {
        let money=$('.usdt_money').text();
        $("#amount").val(money);
    });

    //2020 12 12 18:37  理财开关关闭
    $("#btn-2").click(function () {
        $.ajax({
            type:"post",
            dataType:"json",
            url:"{:U('record_lock')}",
            data:{},
            success:function () {

            }
        })
    })

    $("#btn-1").click(function(){
        var amount = $("#amount").val();
        var from = $("#from").val();
        var password2 = $("#password2").val();
        if(amount === '' ||password2===''){
            layer.msg('Incomplete information',{time:2000});
            return false;
        }
        if(parseFloat(amount) <=0)
        {
            layer.msg("Transfer quantity cannot be less than 0",{time:2000});
            return false;
        }

        // if(parseFloat(amount) < parseFloat(min))
        // {
        //
        //     layer.msg("转账数量不能小于{$configData['canshu18']}",{time:1000});
        //     return false;
        // }

        // if(parseFloat(amount) + parseFloat(fee) > parseFloat(balance))
        //
        // {
        //     layer.msg('账户余额不足',{time:1000});
        //     return false;
        // }
        // layer.confirm('确定兑换吗？', {btn: ['确定', '取消'], title: "提示"},function () {
        layer.confirm('Are you sure to extract？', {icon:3, title: "提示"},function () {
            $.ajax({
                type: 'POST',
                url: "__ACTION__",
                dataType: 'json',
                data: {
                    from:from,
                    amount:amount,
                    password2:password2,
                    lid:{$lockData['id']}
                },
                success: function(data){
                    if(data.code>0){
                        layer.msg(data.message,{time:3000},function () {
                            // window.location.href="{:U('Locked/locked_list')}";
                            window.location.href="{:U('Finance/locked_list')}";

                        });
                        return false;
                        // window.location.href="__ACTION__";
                        // window.location.reload();
                    }
                    else{
                        layer.msg(data.message,{time:3000});return false;
                    }
                }
            })
        });

    });
</script>